#ifndef FILE_se_DrawableDataPool_HPP
#define FILE_se_DrawableDataPool_HPP

#include <vector>

#include "../Storage.hpp"
#include "AnimationData.hpp"

namespace se{
namespace Graphics{

class AnimationData;

/********************************************//**
 * \brief Contains a group of animations, loaded from a file.
 *
 * Contains all the animations of an animation list file.
 * Should be cleaned at each level load if no animation timeout
 * is set (and should be cleaned, anyway, except if the loading 
 * time is critical).
 *
 * Please note that the loading in this context is refering to the presence
 * of the animation in the list, not to the image loading.
 ***********************************************/
class DrawableDataPool{
	DISALLOW_COPY_AND_ASSIGN(DrawableDataPool);
public :
	DrawableDataPool();
	DrawableDataPool(ContentFile &c, uint32_t f);
	~DrawableDataPool();
	
	void SetContentFile(ContentFile &c, uint32_t f);
	void RemoveContentFile();
	
	void LoadAll();
	bool IsLoaded(const std::string& s);
	AnimationData* Get(const std::string& s);
	AnimationData* GetPtr(const std::string& s);
	AnimationData* GetDefault();
	void CleanUp();
	
protected :
	std::vector<AnimationData*> m_DrawableData;
	ContentFile *m_contentFile;
	DataFile m_animationsFile;
	bool m_dynamicAnimationLoadingEnabled;
	
	//functions
	AnimationData* LoadAnim(const std::string& s);
	int32_t GetPos(const std::string& s);
};//</class DrawableDataPool>


}//</namespace Graphics>
}//</namespace se>

#endif
